MenuItemCompat

(SESL variant) Helper for accessing features in MenuItem.

Note: You cannot get an instance of this class. Instead, it provides static methods that correspond to the methods in , but take a MenuItem object as an additional argument.

Types

Link copied to clipboard
Interface definition for a callback to be invoked when a menu item marked with SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW is expanded or collapsed.

Properties

Link copied to clipboard
Link copied to clipboard
Always show this item as a button in an Action Bar.
Link copied to clipboard
This item's action view collapses to a normal menu item.
Link copied to clipboard
Show this item as a button in an Action Bar if the system decides there is room for it.
Link copied to clipboard
Never show this item as a button in an Action Bar.
Link copied to clipboard
When this item is in the action bar, always show it with a text label even if it also has an icon specified.

Functions

Link copied to clipboard
Collapse the action view associated with this menu item.
Link copied to clipboard
Expand the action view associated with this menu item.
Link copied to clipboard
Link copied to clipboard
open fun getActionView(item: MenuItem): View
Returns the currently set action view for this menu item.
Link copied to clipboard
Return the modifier for this menu item's alphabetic shortcut.
Link copied to clipboard
Retrieve the content description associated with this menu item.
Link copied to clipboard
Link copied to clipboard
Returns the blending mode used to apply the tint to the item's icon, if specified.
Link copied to clipboard
open fun getNaviMenuItemType(@NonNull menuItem: MenuItem): Int
Gets the navigation menu item type of the provided menu item.
Link copied to clipboard
Return the modifiers for this menu item's numeric (12-key) shortcut.
Link copied to clipboard
Retrieve the tooltip text associated with this menu item.
Link copied to clipboard
Returns true if this menu item's action view has been expanded.
Link copied to clipboard
Sets the ActionProvider responsible for creating an action view if the item is placed on the action bar.
Link copied to clipboard
open fun setActionView(item: MenuItem, view: View): MenuItem
open fun setActionView(item: MenuItem, resId: Int): MenuItem
Set an action view for this menu item.
Link copied to clipboard
open fun setAlphabeticShortcut(@NonNull item: MenuItem, alphaChar: Char, alphaModifiers: Int)
Change the alphabetic shortcut associated with this item.
Link copied to clipboard
open fun setContentDescription(@NonNull item: MenuItem, @Nullable contentDescription: CharSequence)
Change the content description associated with this menu item.
Link copied to clipboard
Applies a tint to the item's icon.
Link copied to clipboard
Specifies the blending mode used to apply the tint specified by setIconTintList to the item's icon.
Link copied to clipboard
open fun setNumericShortcut(@NonNull item: MenuItem, numericChar: Char, numericModifiers: Int)
Change the numeric shortcut and modifiers associated with this item.
Link copied to clipboard
Set an OnActionExpandListener on this menu item to be notified when the associated action view is expanded or collapsed.
Link copied to clipboard
open fun setSeslNaviMenuItemType(@NonNull menuItem: MenuItem, itemType: Int)
Sets the navigation menu item type of the provided menu item.
Link copied to clipboard
open fun setShortcut(@NonNull item: MenuItem, numericChar: Char, alphaChar: Char, numericModifiers: Int, alphaModifiers: Int)
Change both the numeric and alphabetic shortcut associated with this item.
Link copied to clipboard
open fun setShowAsAction(item: MenuItem, actionEnum: Int)
Sets how this item should display in the presence of a compatible Action Bar.
Link copied to clipboard
open fun setTooltipText(@NonNull item: MenuItem, @Nullable tooltipText: CharSequence)
Change the tooltip text associated with this menu item.